package com.example.demo.niuke;

/**
 * @Description: :输入一个正整数，按照从小到大的顺序输出它的所有质因子（如180的质因子为2 2 3 3 5 ）
 * 最后一个数后面也要有空格
 * @Author: LLL
 * @Date: 2020-03-17 20:55
 **/

import java.util.Scanner;

public class Main {
    public static String getResult(long ulDataInput) {
        if (ulDataInput <= 1) {
            return "";
        }
        StringBuilder sc = new StringBuilder();
        for (int k = 2; k <= ulDataInput; k++) {
            while (ulDataInput % k == 0) {
                sc.append(k).append(" ");
                ulDataInput = ulDataInput / k;
            }
        }
        return sc.toString();
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()) {
            long s = sc.nextLong();
            System.out.println(getResult(s));
        }
    }
}
